﻿using System;
using Microsoft.SharePoint.Administration;
using System.Runtime.InteropServices;
using Microsoft.SharePoint.Utilities;
using System.ServiceModel;
using Microsoft.SharePoint.Administration.AccessControl;

namespace CodeCounsel.SharePoint.NavigationService
{
    [Guid("f46c5a6a-0f73-4c1e-b11b-c2ffb70c19f9")]
    public class NavigationApplication
        : SPServiceApplication
    {
        public override string TypeName
        {
            get { return "Navigation Application (Demo)"; }
        }

        public NavigationApplication()
        {
        }

        public NavigationApplication(string name, NavigationService service)
            : base(name, service)
        {
        }

        public static NavigationApplication Create(string name, NavigationService service)
        {
            NavigationApplication application = new NavigationApplication(name, service);
            application.Update();
            return application;
        }

        public override void Provision()
        {
            Status = SPObjectStatus.Online;
            Update();
        }

        public string GetNavigationInformation()
        {
            return "Demo";
        }
    }
}
